package com.cskaoyan.wxcontroller;


import com.cskaoyan.bean.baseresultVO.BaseRespVo;
import com.cskaoyan.bean.storageBeans.StorageVo;
import com.cskaoyan.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * @User: Yr
 * @Date: 2021/12/3
 * @Description:
 */
@RestController
@RequestMapping("/wx/storage")
public class WxStorageController {

    @Autowired
    StorageService storageService;

    @RequestMapping("upload")
    public BaseRespVo upload(MultipartFile file) throws IOException {
        StorageVo storageVo = storageService.create(file);
        return BaseRespVo.ok(storageVo);
    }
}

